﻿<Window x:Class="UploadClient.View.MainWindowView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:UploadClient"
        xmlns:ex="clr-namespace:UploadClient.Framework" 
        xmlns:view="clr-namespace:UploadClient.View"
        xmlns:behaviors="clr-namespace:UploadClient.Behaviours"
        
        WindowStyle="SingleBorderWindow" ResizeMode="NoResize" SizeToContent="Height" Icon="{StaticResource windowIcon}"
        behaviors:WindowClosingBehavior.CancelClosing="{Binding cancelClosingCommand}"
        behaviors:WindowClosingBehavior.Closing="{Binding closingCommand}"
        Height="100" Width="430">

    <!-- ToDo: Closingevent: http://www.codeproject.com/KB/WPF/WindowClosingBehavior.aspx-->
    
    <Window.Title>
        <MultiBinding StringFormat="{}{0} - Version: {1}">
            <Binding Path="" Source="{x:Static ex:AppObject.AppName}"/>
            <Binding Path="" Source="{x:Static ex:AppObject.AppVersion}"/>
        </MultiBinding>
    </Window.Title>
    
    <Grid  Margin="11,12,11,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
            <StackPanel.Resources>
                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource buttonStyleNew}">
                    <Setter Property="Margin" Value="0,0,11,0"/>
                </Style>
            </StackPanel.Resources>
            <Button ToolTip="{local:Localization Key=UPL_0008}" Command="{Binding OpenFileDialog}" Content="{StaticResource search}"/>
            <Button ToolTip="{local:Localization Key=UPL_0001}" Command="{Binding Upload}" Content="{StaticResource box}"/>
            <Button ToolTip="{local:Localization Key=UPL_0007}" Command="{Binding Cancel}" Content="{StaticResource cancel}"/>
        </StackPanel>
        <ProgressBar Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="100"/>
        <TextBlock Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Text="{Binding StatusText}" />
        <Expander Grid.Row="2" Grid.ColumnSpan="2" Header="{local:Localization Key=UPL_0004}" Margin="0,6,0,6" Padding="0,11,0,11">
            <view:FastConfig DataContext="{Binding Config}"/>
        </Expander>
    </Grid>
</Window>
